	<!-- Comment Section -->
    						<div id="wrap_comment_view">
                            <h5 id="comment_view_h5">Phản hồi (<?php echo $data[num] ?>) :</h5>
                           
                             	<?php if($data[num]>0)
									{
										echo "<div id='comment_view'>";
				   						foreach($data[data] as $row)
										{?>
                                          <div class="each_comment">
                                  		  <p class="author_comment"><span class="comment_user"><?php echo $row['user']; ?></span>
                                          <!-- Level -->
                                          	<span class="level<?php echo $row['level'];?>">
                                            	<?php
												switch($row['level']){
													case "5": echo " [ GUEST ]";break;
													case "4": echo " [ MEMBER ]";break;
													case "3": echo " [ MOD ]";break;
													case "2": echo " [ SMOD ]";break;
													case "1": echo " [ ADMIN ]";break;
												}
												?>
                                            </span>
                                          <!-- End of Level -->
                                           said:</p>
                                         <p class="date_comment"><?php echo $row['time_add'];?></p>
                                         <div class="clear"></div>
                                         <p class="each_comment_content"> <?php echo $row['content'];?></p>
                                         
                                         <?php
										if($row[del]!=1 && $row[status]!=1)
										if($data[per]==1 || $data[per]==2)
										{
										?>
                                        <p style="text-align:right; "> 
        								 <a href="javascript:quote('<?php echo $row[user]; ?>')" title="Quote This Comment"> Reply </a> | 
              						<a href="javascript:delete_comment(<?php echo $row['id']?>,<?php echo $_GET['id'];?>,'chap')" title="Delete This Comment">
                          			Delete</a>
             						  </p>
                                         <?php
										}
										?>
                               
                           		 </div>
                            <?php 
							}
							echo "</div>";
							}
							?>
                </div><!-- end #wrap_comment_view -->
                             	
   	<script>
    // O2k7 skin (silver)
	tinyMCE.init({
		// General options
		mode : "exact",
		elements : "comment_content",
		height:150,
		width:600,
		theme : "advanced",
		skin : "o2k7",
		skin_variant : "silver",
		plugins : "advlink,emotions,preview,media,fullscreen,rj_insertcode,embed",
		// Theme options
		theme_advanced_buttons1 : "bold,italic,underline|,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,link,unlink",
		theme_advanced_buttons2 :"",
		theme_advanced_buttons3 :"",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
		extended_valid_elements : "a[href|rel|rev|target|title|type]",
		invalid_elements : "script,marquee,iframe,object,p" ,
	   theme_advanced_resizing :false,
    	relative_urls : false, // Default value
		remove_script_host : false,

		// Example content CSS (should be your site CSS)
		content_css : "http://localhost/project/public/exts/tinymce/content.css"

	})

</script>
					  <fieldset id="comment">
                            <legend>Viết phản hồi của bạn</legend>
                          			<?php if(!isset($_SESSION['username']))
											{
												?>
                                                <div>
                                             <label><strong>Tên: </strong></label><input type="text" id="comment_user" value="" /></div>
                                            <?php
											}
											else
											{
											?>
                                            <div>
                                            <input type="hidden" id="comment_user" value="<?php echo $_SESSION['username']?>" />  </div>
                                            <?php
											}?>
                                          
                                            <div>
                                           <input type="hidden" id="comment_geturl" value="<?php echo $data[geturl]?>" />
                                         <input type="hidden" id="comment_tieude" value="<?php echo htmlspecialchars($data[tieude],ENT_QUOTES,'UTF-8');?>" />
                                          <input type="hidden" id="comment_url" value="<?php echo url();?>" />
         									<input type="hidden" id="comment_id" value="<?php echo $_GET['id'];?>" />
                                             <input type="hidden" id="ip" value="<?php echo $_SERVER['REMOTE_ADDR'] ;?>" />
                          				</div>
                          
                            <div>
                           <textarea name="comment_content" id="comment_content"></textarea>
                            </div>
                               <div>    <img id="siimage" align="left" style="padding-right: 5px; border: 0" src="libraries/captcha/securimage_show.php?sid=<?php echo md5(time()) ?>" />
             
        <!-- pass a session id to the query string of the script to prevent ie caching -->
       
        <br />
        <a tabindex="-1" style="border-style: none" href="#" title="Refresh Image" onClick="document.getElementById('siimage').src = 'libraries/captcha/securimage_show.php?sid=' + Math.random(); return false"><img src="libraries/captcha/images/refresh.gif" alt="Reload Image" border="0" onClick="this.blur()" align="bottom" /></a> <br />
        <div style="clear:left"></div>
    <label>Captcha</label><input type="text" name="security" id="security" value="" /> </div>
                            <div>
                            <label>&nbsp;</label><input id="send" type="button" value="Gửi" name="ok" onclick="add_comment()" /></div>
                        </fieldset>


                                   
                                
                                
</div>                                

     								             